home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / keyboard < prev    next >
Text File  |  1995-03-31  |  4KB  |  132 lines

  1. Article 6414 of comp.sys.handhelds:
  2. Path: en.ecn.purdue.edu!noose.ecn.purdue.edu!samsung!cs.utexas.edu!helios!tamsun.tamu.edu!ftg0673
  3. From: ftg0673@tamsun.tamu.edu (Rick Grevelle)
  4. Newsgroups: comp.sys.handhelds
  5. Subject: HP48 Keybuffer Polling
  6. Message-ID: <15700@helios.TAMU.EDU>
  7. Date: 2 May 91 03:05:53 GMT
  8. Sender: usenet@helios.TAMU.EDU
  9. Organization: Texas A&M University
  10. Lines: 118
  11.  
  12. Polling the 48's keybuffer directly, through the use of an assembly language
  13. program, is straight forward.  This routine exemplifies the process while
  14. providing a utility for redefining the keyboard on a user level.  Unlike the
  15. SYSTEM RPL routine #41F65h for KEYWAIT that actually puts the 48 in a low 
  16. powered state, this routine loops continuously until a keystroke is detected,
  17. after which the key's numerical value is returned to the stack.  Although
  18. the routine can be easily modified to do so, it is not designed to recognize
  19. any key combinations for Alhpa-shifted, Left-shifted, and Right-shifted
  20. sequences as KEYWAIT does.  This is probably better suited for those who are
  21. primarily interested in controlling the keyboard from machine code, for
  22. this is the reason it was first developed.  The keyboard map should be self
  23. explanatory.
  24.  
  25.  
  26. Rick Grevelle
  27.  
  28.  
  29.  
  30.  
  31.         ---------------------------------------
  32.         | ----------------------------------- |
  33.         | |                                 | |
  34.         | |                                 | |
  35.         | |                                 | |
  36.         | |                                 | |
  37.         | |                                 | |
  38.         | |                                 | |
  39.         | |                                 | |
  40.         | |                                 | |        
  41.         |  ---------------------------------  |
  42.         |                                     |
  43.         | [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] |
  44.         |                                     |
  45.         | [ 7 ] [ 8 ] [ 9 ] [ 10] [ 11] [ 12] |
  46.         |                                     |
  47.         | [ 13] [ 14] [ 15] [ 16] [ 17] [ 18] |
  48.         |                                     |
  49.         | [ 19] [ 20] [ 21] [ 22] [ 23] [ 24] |
  50.         |                                     |
  51.         | [    25   ] [ 26] [ 27] [ 28] [ 29] |
  52.         |                                     |
  53.         | [128] [ 31 ] [ 32 ]  [ 33 ]  [ 34 ] |
  54.         |                                     |
  55.         | [ 64] [ 36 ] [ 37 ]  [ 38 ]  [ 39 ] |
  56.         |                                     |
  57.         | [192] [ 41 ] [ 42 ]  [ 42 ]  [ 44 ] |
  58.         |                                     |
  59.         | [ * ] [ 46 ] [ 47 ]  [ 48 ]  [ 49 ] |
  60.         |                                     |
  61.         ---------------------------------------
  62.  
  63.            * The attention key is disabled
  64.  
  65.  
  66.  
  67.             Keybuffer Polling
  68.  
  69.  
  70.     d9d20      data.a   #02d9d    ; begin rpl
  71.     ccd20      data.a   #02dcc    ; begin code
  72.     97000      data.a   #00079    ; length
  73.  
  74.     8fb9760      call.a   #0679b    ; save registers
  75.  
  76.     1f3c607      move.5   #706c3,d1    ;\
  77.     14f      move.b   @d1,c    ; kill alpha
  78.     80887      clrb     #7,c        ; annunciator
  79.     14d      move.b   c,@d1    ;/
  80.  
  81.     1fb0100      move.5   #0010b,d1    ;\
  82.     14f      move.b   @d1,c    ; kill busy
  83.     80884      clrb     #4,c        ; annunciator
  84.     14d      move.b   c,@d1    ;/
  85.  
  86. poll:    1fbe407      move.5   #704eb,d1    ;\
  87.     1534      move.s   @d1,a    ;
  88.     1c0      sub.a       #1,d1    ; poll buffer for keypress
  89.     1574      move.s   @d1,c    ;
  90.     942be      breq.s   poll buffer    ;/
  91.  
  92.     80df      move.1   c,#f,p    ; save offset
  93.  
  94.     b46      inc.s    c        ; nullify 
  95.     1554      move.s   c,@d1    ; keypress
  96.  
  97.     137      swap.a   c,d1        ;\
  98.     809      add.a    p+1,c    ; determine key location
  99.     809      add.a    p+1,c    ;/
  100.  
  101.     20      move.1   #0,p        ; restore pointer
  102.     135      move.a   c,d1        ; put address of key number in d1
  103.  
  104.     d2      clr.a    c        ;\
  105.     14f      move.b   @d1,c    ; put key number in r0
  106.     108      move.w   c,r0        ;/
  107.     
  108.     8f73560      call.a   #06537    ; push key number as system binary
  109.  
  110.     142      move.a   @d0,a    ;\
  111.     164      add.a    #5,d0    ; continue rpl
  112.     808c      jump.a   @a        ;/
  113.  
  114.     fbd81      data.a   #18bdf    ; system binary->real
  115.     b2130      data.a   #0312b    ; end rpl
  116.  
  117.  
  118.  
  119. o  /
  120.  \/
  121.  /\  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  122. o  \
  123.  
  124. KEYWAIT
  125.  
  126. %%HP: T(1)A(D)F(.);
  127. "D9D20CCD20970008FB97601F3C60714F8088714D1FB010014F8088414D1FBE40
  128. 715341C01574942BE80DFB46155413780980920135D214F1088F735601421648
  129. 08CFBD81B2130EDB0"
  130.  
  131.  
  132.